#ifndef CPCAPIPV4PACKET_H
#define CPCAPIPV4PACKET_H

#include "pcappacket.h"

class CPCapIpv4Packet : public CPCapPacket
{
    Q_OBJECT
    Q_PROPERTY(QString ttl READ ttl WRITE setTTL NOTIFY ttlChanged)
    Q_PROPERTY(QString protocol READ protocol WRITE setProtocol NOTIFY protocolChanged)
    Q_PROPERTY(QString sourceIp READ sourceIp WRITE setSourceIp NOTIFY sourceIpChanged)
    Q_PROPERTY(QString destIp READ destIp WRITE setDestIp NOTIFY destIpChanged)
public:
    explicit CPCapIpv4Packet(QObject *parent = Q_NULLPTR);
    ~CPCapIpv4Packet();

    QString ttl() const;
    void setTTL(const QString &ttl);

    QString protocol() const;
    void setProtocol(const QString &protocol);

    QString sourceIp() const;
    void setSourceIp(const QString &sourceIp);

    QString destIp() const;
    void setDestIp(const QString &destIp);

    int headerLength() Q_DECL_OVERRIDE;
    bool buildHeader(QByteArray &header) Q_DECL_OVERRIDE;

Q_SIGNALS:
    void ttlChanged();
    void protocolChanged();
    void sourceIpChanged();
    void destIpChanged();

private:
    QString m_ttl;
    QString m_protocol;
    QString m_sourceIp;
    QString m_destIp;
};

#endif // CPCAPIPV4PACKET_H
